<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>随机选择器</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="renderer" content="webkit"><!--360默认为极速模式打开-->
    <!--坑爹的IE兼容-->
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <script src="http://libs.baidu.com/jquery/2.0.0/jquery.min.js"></script>
    <script src="http://libs.baidu.com/bootstrap/3.0.3/js/bootstrap.min.js"></script>
    <link href="http://libs.baidu.com/bootstrap/3.0.3/css/bootstrap.min.css" rel="stylesheet">
    <link rel="stylesheet" href="style.css">
</head>
<body style="background-color: #e9ebe9">
<div>
    <div>
        <div class="container" style="width: 850px;height: 500px;margin-top: 80px;background-color: #cac9c6">
            <div class="row">
                <div class="a col-md-4">
                    <form action="">
                        <table id="tab1" style="margin-left: 50px">
                            <tr><td style="text-align: center"><b>请输入姓名</b></td></tr>
                            <tr><td><input type="text" value=""/></td></tr>
                            <tr><td><input type="text" value=""/></td></tr>
                            <tr><td><input type="text" value=""/></td></tr>
                            <tr><td><input type="text" value=""/></td></tr>
                            <tr><td><input type="text" value=""/></td></tr>
                            <tr><td><input type="text" name="a" id="a1" /></td></tr>
                            <tr>
                                <td align="left"><input type="reset" value="重置" /></td>
                                <td align="right"><input type="button" value="+" style="height: 27px;width: 27px;
                                font-size: 20px;line-height:10px;" onclick="javascript:AddRow();"/></td>
                            </tr>
                        </table>
                    </form>
                </div>
                <div class="d col-md-4" align="center" >
                    <ul>
                        <li><button class="d1" onclick="">随机抽取</button></li>
                        <li><button class="d1" onclick="">随机排序</button></li>
                    </ul>
                </div>
                <div class="a col-md-4" align="center">
                    <div class="a col-md-4" id="a">
                        <table id="" style="margin-top: -50px">
                            <tr><td style="text-align: center"><b>输出结果</b></td></tr>
                            <tr><td><input type="text"/></td></tr>
                            <tr><td><input type="text"/></td></tr>
                            <tr><td><input type="text"/></td></tr>
                            <tr><td><input type="text"/></td></tr>
                            <tr><td><input type="text"/></td></tr>
                            <tr><td><input type="text"/></td></tr>
                        </table>
                    </div>
                </div>
            </div>
        </div>

        <div></div>
    </div>
</div>
<script  language="javascript" type="text/javascript">
    function AddRow() {
        var i =tab1.rows.length;
        var Cod="a"+i;
        var newTr = tab1.insertRow();
        var newTd = newTr.insertCell();
        newTd.innerHTML = '<input type="text" id='+Cod+' />';
    }
</script>
<script>
    function ($){
        var arr = $('tr td').toArray();
        var len = arr.length;
        var rand = parseInt(Math.random()*(len));
        $('tr td').each(function(i){
            $('tr').append($('tr td').eq(rand));
            rand = parseInt(Math.random()*(len));
        });

    }
</script>
</body>
</html>